﻿@{
    ViewBag.Title = "意见反馈";
    Layout = "~/Views/Shared/_layoutPersonal.cshtml";
}
@Styles.Render("~/Content/css/feedback")
<article class="main">
    <div class="lay">
        <nav class="mod_nav">
            <div class="lay_left">
                <a class="nav_back" onclick="turnBack()"><img src="/images/return_1.png" ontouchstart="replaceBackImage(this, 1)" ontouchend="replaceBackImage(this, 2)"></a>
                <span>意见反馈</span>
            </div>
            <div class="lay_right">
                <a class="disable_btn_send" id="sendBtn" onclick="sendFeedback()">发送</a>
            </div>
        </nav>
        <div class="lay_top">
            <textarea id="feedbackcontent" class="textarea" placeholder="请输入反馈，我们将不断为您改进" onkeyup="return showTurnSendButton();"></textarea>
            <input class="input_text" placeholder="您的邮箱或手机号码（选填）" type="text">
        </div>
    </div>
</article>
<script>
    $(function () {
        $(".disable_btn_send").css("opacity", "0.5")
    });
    function showTurnSendButton() {
        var feedBack = $.trim($("#feedbackcontent").val());
        if (feedBack != "") {
            $(".disable_btn_send").css("opacity", "1");
        } else {
            $(".disable_btn_send").css("opacity", "0.5");
        }
    }
    function sendFeedback() {
        var content = $(".textarea").val();
        var contact = $(".input_text").val();
        if (content.length == 0) {
            $(".textarea").focus();
            venderDialog("请输入反馈内容，谢谢！");
        } else {
            OtherMgr.sendFeedback(content, contact);
            $(".disable_btn_send").css("opacity", "0.5")
            venderDialog("您的意见我们已经收到，十分感谢！", function () {
                window.history.back();
            });
            loadingHide();
        }
    }

    function turnBack() {
        window.history.back();
    }
</script>
